<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>UserNamePasswordLogin</title>
    <script type="text/javascript" src="/js/easyui/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#submit').click(function () {
                var username = $('#username').val();
                var password = $('#password').val();

                $.ajax("/boss/index", {
                    type: "POST",
                    data: {username: username, password: password},
                    statusCode: {
                        200: function (datas) {
                            window.location.href = "/boss/index";
                        },
                        401: function (datas) {
                            alert('登录失败');
                        }
                    }
                });
            });
        });
    </script>
</head>
<body>
<p>UserNamePasswordLogin</p>
用户名:<input type="text" name="username" id="username" value=""/>
<br/>
密&nbsp;&nbsp;&nbsp;码:<input type="text" name="password" id="password"/>
<br/>
<button type="button" id="submit">提交</button>
</body>
</html>